/**
 * @(#)ClientRunInfo.java 2017年2月22日
 * Copyright(C) 2017 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.domian.channel;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSON;

/**
 * 客户端运行信息
 * @author <a href="mailto:zhouchao@xingbook.com" >周超</a>
 * @version 1.0.0
 */
public class ClientRunInfo {
	public static final Logger LOGGER = LoggerFactory.getLogger(ClientRunInfo.class);
	
	public static final int ON_LINE=0;
	public static final int OFF_LINE=1;
	
	private static final int WAITTING=0;
	
	
	/**
	 * 0、任务待执行 1、空闲   2、正在执行任务  3、已完成任务  4、执行失败  5、拒绝执行任务 
	 */
	private Integer actionType;
	/**
	 * 客户端IP(能否直接从request中获取)
	 */
	private String clientIp;
	private String clientMac;
	/**
	 * 机柜
	 */
	private String location;
	/**
	 * 母包版本
	 */
	private String version;
	/**
	 * 系统版本
	 */
	private String osVersion;
	/**
	 * 0 正常  1表示休息中(暂停做任务)
	 */
	private Integer status;
	/**
	 * 设备ID
	 */
	private String uuid;
	/**
	 * 任务ID
	 */
	private String taskId;
	/**
	 * 0表示在线，1表示离线
	 */
	private Integer online;
	
	private String currentTime;
	
	private String heartVersion;
	
	public Integer getActionType() {
		return actionType;
	}
	public void setActionType(Integer actionType) {
		this.actionType = actionType;
	}
	public String getClientIp() {
		return clientIp;
	}
	public void setClientIp(String clientIp) {
		this.clientIp = clientIp;
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public String getOsVersion() {
		return osVersion;
	}
	public void setOsVersion(String osVersion) {
		this.osVersion = osVersion;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public String getUuid() {
		return uuid;
	}
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	public String getTaskId() {
		return taskId;
	}
	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}
	public Integer getOnline() {
		return online;
	}
	public void setOnline(Integer online) {
		this.online = online;
	}
	
	public String getCurrentTime() {
		return currentTime;
	}
	public void setCurrentTime(String currentTime) {
		this.currentTime = currentTime;
	}
	public boolean hasBusy(){
		if(this.actionType==ClientHeartBeat.RUNNING){
			return true;
		}
		return false;
	}

	public void waitting(){
		this.actionType=WAITTING;
	}
	
	public String getHeartVersion() {
		return heartVersion;
	}
	public void setHeartVersion(String heartVersion) {
		this.heartVersion = heartVersion;
	}
	
	public String getClientMac() {
		return clientMac;
	}
	public void setClientMac(String clientMac) {
		this.clientMac = clientMac;
	}
	@Override
	public String toString(){
		return JSON.toJSONString(this);
	}
	
	
	
}
